import 'package:flutter/material.dart';
import 'package:top_foundation/component/wrap.dart';
import 'package:top_foundation/utils/theme/button.dart';

import 'package:whale/helper/utils/util.dart';

import 'index.dart';

class ImInputAddPage extends StatelessWidget {
  ImInputAddPage({Key? key}) : super(key: key);
  final controller = Get.put(ImInputAddController());
  final state = Get.find<ImInputAddController>().state;
  @override
  Widget build(BuildContext context) {
    return GetBuilder<ImInputAddController>(
      builder: (_) {
        return Container(
          height: 250,
          width: double.infinity,
          padding: EdgeInsets.all(16.r),
          child: IWrap(
            itemBuilder: (context, index) {
              var m = state.list[index];
              return IButton.create(
                  onPressed: m.onTap,
                  child: IButtonContent(
                    text: m.text,
                    icon: m.data,
                    iconSize: Size(35.r, 35.r),
                  ));
            },
            itemCount: state.list.length,
          ),
        );
      },
    );
  }
}
